package com.v5ba.event;

import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;

public class EditUserListener implements ApplicationListener<EditUserEvent> {
    @Async
    @Override
    public void onApplicationEvent(EditUserEvent editUserEvent) {
        System.out.println(Thread.currentThread().getName());
        EditUser editUser = (EditUser)editUserEvent.getSource();
        try {
            Thread.sleep(1000 * 2);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("EditUserListener:"+editUser.getName());
    }
}
